package com.cch.datageniebackendmaster.config;

import org.redisson.Redisson;
import org.redisson.api.RedissonClient;
import org.redisson.config.Config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile;

/**
 * Redisson 配置类
 *
 * @author cch
 */
@Configuration
@Profile("dev")
public class RedissonConfig {

    @Bean
    public RedissonClient redissonClient() {
        // 1、创建配置
        Config config = new Config();
        config.useSingleServer().setAddress("redis://localhost:6379");
        // 2、创建实例
        return Redisson.create(config);
    }

}
